import { FC, useEffect } from 'react';
import SimpleList from '@/components/SimpleList';
import { useModel } from 'umi';

const columns: any[] = [
  {
    title: '许可证编号',
    dataIndex: 'N001',
    width: 300,
  },
  {
    title: '许可文件名称',
    dataIndex: 'N002',
    width: 230,
  },
  {
    title: '有效期自',
    dataIndex: 'N004',
    width: 210,
  },
  {
    title: '有效期至',
    dataIndex: 'N005',
    width: 210,
  },
  {
    title: '许可内容',
    dataIndex: 'N003',
    width: 365,
  },
];

const AdministrativeLicensing: FC = () => {
  const { administrativeLicensing, getAdministrativeLicensing } =
    useModel('company');
  useEffect(() => {
    const id = window.sessionStorage.getItem('companyId') || '';
    getAdministrativeLicensing({ id });
  }, []);
  return (
    <SimpleList
      width={1790}
      height={220}
      columns={columns}
      dataSource={administrativeLicensing}
      headerStyle={{
        height: 42,
        backgroundColor: 'rgba(141, 141, 141, 0.1)',
      }}
      sortNumber
      sortText="序号"
      rowStyle={{
        height: 42,
      }}
      sortStyle={{
        width: 88,
      }}
      hover
      odd
      rowBackground
    />
  );
};
export default AdministrativeLicensing;
